{% extends 'layout.html' %}

{% load my_tags %}

{% block content %}

    <div>
        <a href="{% url 'crm:consult_record_add' %}" class="btn btn-primary btn-sm">新增</a>
    </div>


    {#    <form action="" method="post" class="form-inline">#}

    {#        {% csrf_token %}#}

    {#        <select name="action" id="" class="form-control">#}
    {##}
    {#            {% if request.path_info == url %}#}
    {#                <option value="multi_apply">公户变私户</option>#}
    {#            {% else %}#}
    {#                <option value="multi_pub">私户变公户</option>#}
    {#            {% endif %}#}
    {##}
    {#            <option value="multi_del">批量删除</option>#}
    {##}
    {#        </select>#}
    {#        <button class="btn btn-primary btn-sm">提交</button>#}

    <table class="table table-bordered table-hover">
        <thead>
        <tr>

            <th>序号</th>
            <th>客户</th>
            <th>跟进内容</th>
            <th>跟进状态</th>
            <th>跟进日期</th>
            <th>跟进人</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        {% for consult_record in all_consult_record %}
            <tr>

                <td>{{ forloop.counter }}</td>
                <td>{{ consult_record.customer }}</td>
                <td>{{ consult_record.note|truncatechars:20 }}</td>
                <td>{{ consult_record.get_status_display }}</td>
                <td>{{ consult_record.date }}</td>
                <td>{{ consult_record.consultant }}</td>

                <td>
                    <a class="btn btn-sm btn-danger"
                       href="{% url_tag request 'crm:consult_record_edit' consult_record.pk %}">编辑</a>

                </td>

            </tr>
        {% endfor %}

        </tbody>
    </table>
    {#    </form>#}
    <nav aria-label="Page navigation">
        <ul class="pagination">

            {{ page_html }}
        </ul>
    </nav>


{% endblock %}